<?php
class Tanque extends Modelo_base {

	var $table = 'tanques';

	var $has_one = array('fluido');
    var $has_many = array('movimiento');

    // Validaciones de campos
    var $validation = array(
        'capacidad' => array(
            'label' => 'Capacidad del tanque',
            'rules' => array('required', 'float'),
            'get_rules' => array('float')
            ),
         'identificacion' => array(
            'label' => 'Identificación',
            'rules' => array('required', 'trim', 'max_length' => 45, 'unique'),
            'get_rules' => array('trim')
            ),
        'eliminado' => array(
            'label' => 'Dado de baja',
            'rules' => array('boolean')
            ),
       
        'stock' => array(
            'label' => 'Stock',
            'rules' => array('required', 'float'),
            ),
        'stockMinimo' => array(
            'label' => 'Stock',
            'rules' => array('float'),
            )
        
    );

    // Optionally, don't include a constructor if you don't need one.
    function __construct($id = NULL)
    {
        parent::__construct($id);
    }

    public function getFluido()
   {
       return new fluido($this->fluidos_id);
   }
}

/* End of file user_rol.php */
/* Location: ./application/models/user_rol.php */